home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume4 / tvx / part02 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  43.2 KB

  1. From: talcott!seismo!gatech!unmvax!wampler (Bruce Wampler)
  2. Subject: tvx: 2 of 10
  3. Newsgroups: mod.sources
  4. Approved: jpn@panda.UUCP
  5.  
  6. Mod.sources:  Volume 4, Issue 16
  7. Submitted by: talcott!seismo!gatech!unmvax!wampler (Bruce Wampler)
  8.  
  9. #--------CUT---------CUT---------CUT---------CUT--------#
  10. #########################################################
  11. #  TVX: part 2 of 10
  12. #                                                       #
  13. # This is a shell archive file.  To extract files:      #
  14. #                                                       #
  15. #    1)    Make a directory (like tvx) for the files.      #
  16. #    2) Write a file, such as "filen.shar", containing  #
  17. #       this archive file into the directory.           #
  18. #    3) Type "sh file.shar".  Do not use csh.           #
  19. #                                                       #
  20. #########################################################
  21. #
  22. #
  23. echo Extracting README:
  24. sed 's/^X//' >README <<\SHAR_EOF
  25. X    TVX - A full screen editor in C
  26. X
  27. X===========================================================================
  28. X**************************** RELEASE NOTES ********************************
  29. X
  30. XVersion 3/6/86
  31. X
  32. X    * This is the second major release of TVX, distributed
  33. X      on mod.sources.  All files needed to build TVX for other
  34. X      systems are included on this distribution, also.
  35. X
  36. X    * The last section of the manual contains instructions for
  37. X      porting TVX to other environments.
  38. X
  39. X===========================================================================
  40. X
  41. X    Developed by:
  42. X        Dr. Bruce E. Wampler
  43. X        University of New Mexico
  44. X        Department of Computer Science
  45. X        Farris Engineering Center
  46. X        Albuquerque, NM 87131
  47. X    ..{ucbvax | seismo!gatech | ihnp4!lanl}!unmvax!wampler
  48. X
  49. X
  50. X   This version of TVX Copyright (c) 1986 by Bruce E. Wampler
  51. X
  52. X   Permission is hereby granted for free, unrestricted nonprofit
  53. X   use of this software.  Please feel free to modify, distribute,
  54. X   and share this software as long as you aren't making any money
  55. X   from it.  If you want to use this code in a profit making environment,
  56. X   please contact the author for permission.
  57. X
  58. XUnix RELEASE NOTES:
  59. X
  60. X********* Description of files included in distribution: *********
  61. X
  62. X    README     - this file
  63. X
  64. X    tvx_ref1.doc - documentation, ready for 80 col, 10 cpi, 66 line printer
  65. X    tvx_ref2.doc - 2nd part, use cat to combine 1 and 2
  66. X    tvx_tut.doc - short beginner's tutorial
  67. X
  68. X    tvx.ref - text quick reference charts for TVX
  69. X    vix.ref - quick reference chart for vi emulator
  70. X    emax.ref - quick reference chart for emacs emulator
  71. X
  72. X
  73. X    Makefile.BSD - Makefile for BSD unix build
  74. X    Makefile.SYSV - Makefile for System V unix build
  75. X
  76. X    tvx_1.c       - main part of code (part 1), mostly os/terminal independent
  77. X    tvx_2.c       - main part of code (part 2), mostly os/terminal independent
  78. X    tvx_lex.c  - defaults, some os dependent stuff in here.  Major
  79. X             changes in defaults can be fixed by recompiling this file.
  80. X    tvx_io.c   - almost all I/O, including screen, confined to this file.
  81. X    tvx_lib.c  - misc library routines needed by TVX.
  82. X    tvx_unix.c  - contains unix specific code, including termcap driver
  83. X
  84. X    tvx_defs.ic - #define's for version, os, terminal, defaults
  85. X        tvx_glbl.ic - global data structures
  86. X    tvx_term.ic - definitions for various terminals and systems
  87. X
  88. X
  89. X    tvx_cfg.c   - used to build CONFIG.TVX file for -c switch
  90. X    tvx_ptch.c  - used to apply CONFIG to TVX.EXE permanently
  91. X
  92. X----- Misc. files for other systems ------
  93. X
  94. X    tvx_make.bat - batch file to compile IBM-PC tvx with cii c-86
  95. X    tvx_ibm.c  - IBM-PC screen driver
  96. X
  97. X    atari.info - misc files needed to build TVX on an Atari ST
  98. X
  99. X===========================================================================
  100. SHAR_EOF
  101. echo Extracting tvx.ref:
  102. sed 's/^X//' >tvx.ref <<\SHAR_EOF
  103. X        *** TVX Quick Reference Summary ***
  104. X
  105. X  Usage: tvx filename [-b -i -l -o=f -r -s -t -w -# {-z -c=f}]
  106. X
  107. X    -[no]b : backup file           -[no]i : autoindent
  108. X    -[no]l : make command log file -t : tty mode
  109. X    -o=outputfile                  -r : read only
  110. X    -s : big save buff             -[no]w : word processing mode
  111. X    -# : set virtual window lines to #
  112. X  On MS-DOS versions:
  113. X    -[no]z : use control-z for end of file
  114. X    -c=configfile                  -c : use /bin/config.tvx
  115. X
  116. X               TVX Commands (n => count allowed)
  117. X
  118. X    nA Append lines to save buffer (previous contents retained)
  119. X     B Buffer beginning - move cursor to top of current buffer
  120. X    ^B File beginning - move cursor to beginning of file
  121. X    nC Change chars - delete n characters, enter insert mode
  122. X    nD Down line - move cursor to beginning of next nth line
  123. X   n^D Down column - move to same column in nth line down.
  124. X     E Buffer end - move cursor to end of current buffer
  125. X   n^E Insert repeat buffer n into current text for Editing
  126. X    nF Find pattern - terminated with Escape - wild cards possible
  127. X    ^F Find across buffs - searches across file buffers
  128. X     G Get save buffer - insert contents of save buffer into text
  129. X    ^G Unkill last line - get back the last single line killed
  130. X    nH Half page - move cursor down (+n) or up (-n) half screen
  131. X    nI Insert (till $) - If n supplied, then single char inserted
  132. X     J Jump back to line cursor was on before previous command
  133. X    nK Kill character - deletes starting at char cursor is over
  134. X   n^K Kill line - deletes n lines
  135. X    nL Left - move cursor n characters left
  136. X     M Memory status - show basic status
  137. X    nN Note current location, up to 9 different places remembered
  138. X   n^N Reset location - return cursor to location n
  139. X    nO Open blank line - new line in front of cursor
  140. X    ^O Operating system - allows operating system commands
  141. X    nP Page - move cursor up (-n) or down (+n) screenfuls
  142. X    ^P Print screen - only on PCs
  143. X    nR Right - move cursor right n characters
  144. X    ^R Restore edited buffer - Used with ^E command
  145. X    nS Save n consecutive lines in save buffer - deletes old contents
  146. X    nT Tidy (fill text) - uses margin set by :w
  147. X    ^T Abort session - edits are lost!
  148. X    nU Up - move cursor up n lines to line beginning
  149. X   n^U Up column - retains column
  150. X     V Verify - repaints the screen
  151. X   n^W Write buff, get next part of large file, -n writes to cursor
  152. X    ^X Exit, end session - save edits
  153. X   n^Y Yank to(-n)/from(+n) file - prompt for filename will follow
  154. X   nBS Delete character before the cursor
  155. X    n; Find again - re-uses last find pattern
  156. X     / Delete "last thing" - following g, s, a, f, ^f commands
  157. X     = Change "last thing" - like /, but enters insert mode
  158. X     ' Delete to line beginning - deletes before cursor
  159. X     " Delete to line end - cursor onward to end of line
  160. X     , Line beginning - move cursor to beginning of line
  161. X     . Line end - move to end of current line
  162. X  nTAB Word right - move to begining of word to right
  163. X    n{ Word left - left a word. n=0 move to beg of current word.
  164. X n<>$$ Repeat loop - execute commands between <>'s n times
  165. X    n& Repeat again - execute current repeat buffer again
  166. X   n#k Execute repeat buffer k n times
  167. X     ? Help - gives a help screen
  168. X     @ Invoke cmd file - execute file of TVX commands
  169. X     * Insert pattern found last - leaves in command mode
  170. X    n~ Toggle case - upper to lower, lower to upper
  171. X     $ Escape - end insert, find, repeat
  172. X   n:p Set parameter p -  Possible parameters:
  173. X        A - Autoindent (1=y,0=n)     D - display line
  174. X        E - Expand tabs to n spaces  F - find case (0=exact,1=any)
  175. X        M - Match wild cards         O - set output file name
  176. X        S - scroll window            R - repeat buffer to use
  177. X        T - tty mode                 U - define user wild card set
  178. X        V - virtual window           W - autowrap width
  179. X        C - cut mode
  180. X
  181. X  Wild card matching - when wild card matching (:M) is enabled (default),
  182. X  the following wild cards (control characters) are supported
  183. X
  184. X  ^A - alphanumeric character (a-z,0-9)   ^D - a digit (0-9)
  185. X  ^L - any letter (a-z) ^O - Other - not ^A  ^P - Punctuation
  186. X  ^X - any single character  ^U - a character from user set (:U to set)
  187. X  Any of the above preceded by ^W matches a "word" of the wild card.
  188. X  A ^N will match a "word" of characters NOT in the wild card set.
  189. X
  190. SHAR_EOF
  191. echo Extracting vix.ref:
  192. sed 's/^X//' >vix.ref <<\SHAR_EOF
  193. X               VIX - A vi-like editor based on TVX
  194. X
  195. X    Vix is an extension to tvx that provides a close emulation
  196. Xof the Unix editor vi.  While the majority of the common commands
  197. Xare identical, there are some inherent differences in the way tvx
  198. Xand vi treat text.  Most of the commands were implemented directly
  199. Xusing the TVX equivalent, although some commands were required new
  200. Xcode.  If the vi command could not be implemented, its command letter
  201. Xwas left unused, and will produce an error message.
  202. X
  203. X    Vix does not have the underlying ex editor, so none of the
  204. Xescape to ex commands work.  Vix does have the TVX repeat loop,
  205. Xhowever, and this compensates to a great extent for the need for ex
  206. Xfeatures. Please consult the TVX manual for examples of using the
  207. Xrepeat loop.  Note that when using the repeat loop with vix, the commands
  208. Xwill be vix commands and not tvx commands.
  209. X
  210. X    Another significant difference is that tvx (and thus vix)
  211. Xtreats the end of line character as just another character.  Thus
  212. Xcursor movement commands move over the end of line in a fashion one
  213. Xwould expect.  However, when one moves to the end of the line, the
  214. Xcursor is placed 'over' the newline (displayed after the last real
  215. Xcharacter in the line).  This makes the '$' command work somewhat
  216. Xdifferently. This also means that you can include a <return> in a
  217. Xsearch pattern. Vix and tvx use ESCAPE to end the search pattern
  218. Xinstead of <return>.
  219. X
  220. X    Vi uses the ':' command to read and write the file (among
  221. Xother things).  Vix uses the ':' to set operating parameters such
  222. Xas autoindent, screen size, etc.  The 'ZZ' (or 'ZA' to abort without
  223. Xchanges) command is used by vix to exit.
  224. X
  225. X    Unlike vi and ex, tvx and vix try to load the entire file
  226. Xbeing edited into memory (called the buffer by tvx/vix, as opposed
  227. Xto the yank or save buffer).  If the entire file doesn't fit, the
  228. Xuser must manually 'page' the file in and out of memory manually. 
  229. XMost of the 'q' ("tvx" prefix) commands are supplied to handle buffer
  230. Xmanipulation.  For more details, consult the TVX manual.  TVX/vix
  231. Xalso uses the concept of the "last thing" as a major editing tool.
  232. XWhenever you find a pattern, skip over a word with b or w, save text
  233. Xinto the save buffer with the 'y' or 'Y' commands, or put text from
  234. Xthe save buffer, that text is considered the "last thing". The 'c/'
  235. Xand 'd/' commands will delete the last thing.  Entering a new command
  236. Xwill forget what the last thing was until you again enter a "last
  237. Xthing" command.
  238. X
  239. X    The available vix commands are summarized below.  The first
  240. Xcolumn of each entry has a character noting similarities and 
  241. Xdifferences with the real vi commands in the following fashion:
  242. X
  243. X- means present in vi, not implemented in vix.
  244. X= means commands work identically {with possible minor variations}
  245. X+ means new or significantly different command
  246. X* means "equivalent" command, somewhat different than vi
  247. X<space> means command unused in both vi and vix.
  248. X
  249. X  n in front of command means command takes count argument
  250. X  [synonyms indicated in brackets]
  251. X
  252. X   ^@: Unused
  253. X   ^A: Unused
  254. X= n^B: Backward window. {2 lines of continuity not preserved}
  255. X   ^C: Unused
  256. X= n^D: Down half window.
  257. X-  ^E: Not implemented
  258. X= n^F: Forward window.
  259. X*  ^G: memory status, short info line
  260. X= n^H: backspace Command mode: left; Insert mode: del last char
  261. X=  ^I: inserts tab in insert mode, not a command.
  262. X= n^J: down arrow in column [j,^N]
  263. X+ n^K: up in column [k,^P]
  264. X=  ^L: verify screen [^R,z]
  265. X= n^M: down to beginning of line [+]
  266. X= n^N: [j, ^J]
  267. X   ^O: Unused
  268. X= n^P: [k, ^K]
  269. X=  ^Q: Unused (flow control)
  270. X=  ^R: Redraw screen [^L,z]
  271. X=  ^S: Unused (flow control)
  272. X+  ^T: TVX prefix command - see q [q,Q,T]
  273. X* n^U: Up half window.  ** in insert mode, does NOT erase line **
  274. X*  ^V: Not a command.  NOT literal quote in insert mode.
  275. X*  ^W: Not a command.  NOT used for delete word in insert.
  276. X   ^X: Unused
  277. X-  ^Y: Not implemented
  278. X-  ^Z: Not implemented
  279. X=  Escape: forces command mode, safe follow char for d,c,q.
  280. X   ^\: Unused
  281. X-  ^]: Not implemented
  282. X-  ^^: Not implemented
  283. X   ^_: Unused
  284. X=  <space>:  [r]
  285. X+  n!: Tidy.  Fills n lines up to wrap margin. [see autowrap]
  286. X-   ": Not implemented
  287. X+ n#p: execute repeat loop number 'p' 'n' times
  288. X=   $: goto end of current line {end is newline, not last char}
  289. X-   %: Not implemented
  290. X-   &: Not implemented
  291. X-   ': Not implemented
  292. X-   (: Not implemented
  293. X-   ): Not implemented
  294. X+   *: insert last matched pattern into text buffer
  295. X=  n+: [CR, ^M]
  296. X-   ,: Not implemented
  297. X*   -: Used in vix for negative counts, use K for up line.
  298. X-   .: Not implemented, repeat loops are a substitute
  299. X=   /: search {Escape used to end pattern, multi-line patterns ok}
  300. X*   0: 0 is used for counts (especially for : parameters)
  301. X= 0-9: count value for numeric arguments {may be negative!}
  302. X-   :: Not implemented - use ZZ and ZA to exit
  303. X-   ;: Not implemented
  304. X+  n<: Begin repeat loop. Loop terminated with >$$. ($ = Esc)
  305. X+   =: Help screens
  306. X+   >: Used to terminate repeat loops.
  307. X=   ?: Reverse search {search begins on previous line}
  308. X+  n@: execute current repeat loop n times (shorthand for n#p)
  309. X=   A: append to end of line
  310. X*  nB: back a word {vix's concept of words is different than vi}
  311. X=   C: changes rest of line
  312. X=   D: delete rest of the line
  313. X-   E: Not implemented
  314. X-   F: Not implemented
  315. X=  nG: goes to line number n, or end of buffer if no n supplied
  316. X*   H: Beginning of buffer (first line in buffer)
  317. X=   I: inserts at beginning of line
  318. X=   J: join lines {not needed since vix treats newlines as chars}
  319. X+  nK: Up a line to beginning of line
  320. X*   L: bottom line of file
  321. X+  nM: return to marked location n (n from 1 to 9, see m)
  322. X=   N: like n, but in reverse direction
  323. X=  nO: open a line above current line. n opens n blank lines.
  324. X=   P: put save buffer above current line {save buffers not named}
  325. X+   T: tvx commands (see q) [^T,q,Q]
  326. X*   U: very limited undo!! It only restores the LAST line killed!
  327. X    V: Unused
  328. X*  nW: Moves forward n words [w] {vix's concept of words not same}
  329. X=  nX: delete n characters before cursor
  330. X+  nY: append n lines to save buffer (see y), does not change buffer
  331. X=+ Zx: exit from vix (ZZ: normal, writes file, ZA: abort, no changes)
  332. X-  [[: Not implemented
  333. X    \: Unused
  334. X-  ]]: Not implemented
  335. X=   ^: beginning of line {1st char of line, NOT 1st non-white char}
  336. X+   _: invoke indirect command file
  337. X=   a: append text starting after cursor
  338. X*   b: back up a word [see B]
  339. X=   c: change c, <sp>, ^, $, or / (delete, enter insert mode)
  340. X    =   c - change line
  341. X    =   <sp> - change one character
  342. X    =   ^ - to beginning of line
  343. X    =   $ - to end of line
  344. X    -   w, b, and any others not mentioned not implemented
  345. X    +   / - the last thing found, yanked or put
  346. X=  nd: delete d, <sp>, ^, $, or /
  347. X    =   d - delete line
  348. X    =   <sp> - delete character
  349. X    =   ^ - to beginning of line
  350. X    =   $ - to end of line
  351. X    -   w, b, and any others not mentioned not implemented
  352. X    +   / - the last thing found, yanked or put
  353. X-   e: Not implemented
  354. X-   f: Not implemented
  355. X    g: Unused
  356. X=  nh: Move left n characters [BS,^H] {will move over lines, too}
  357. X=  ni: insert (if value n supplied, then that ascii code inserted)
  358. X=  nj: down lines, in column [^J,^N]
  359. X=  nk: Up lines, in column [^K,^P]
  360. X=  nl: right n characters [<space>] {moves over lines, too}
  361. X*  nm: mark cur. line as location n.  Use M to return to location.
  362. X=   n: find next (in same direction as last ? or /)
  363. X=  no: open n following lines
  364. X=   p: put save buffer after cur line
  365. X+   q: Prefix character for "tvx" extended commands
  366. X        !: call operating system
  367. X        b: goto real beginning of the file
  368. X        e: edit repeat buffer
  369. X        j: jump back to last location
  370. X        p: put external file from save buffer
  371. X        r: restore repeat buffer
  372. X        s: print screen
  373. X        w: read in next page of file
  374. X        y: yank external file to save buffer
  375. X        /: cross buffer search
  376. X      n:p: set parameter 'p' to value 'n', parameters are:
  377. X         a: autoindent (1 means on, 0 off for all "switch" pars)
  378. X         c: "cut" mode (means 'dd' saves line in yank buffer, too)
  379. X         e: expand tabs to n spaces (8 default)
  380. X         d: home display line (where cursor homes after verify)
  381. X         f: find case mode (0 is case insensitive, 1 exact match)
  382. X         m: match wildcards (1 use ^A, ^L, etc., 0 no wild cards)
  383. X         o: requests new name for output file
  384. X         s: scroll window, cursor moves s lines before scrolling
  385. X         t: tty mode - 1: tty mode, 0: visual mode
  386. X         u: requests entry of user wild card set
  387. X         v: virtual window size
  388. X         w: autowrap limit.
  389. X=   r: replace next char with next character entered
  390. X=  ns: substitute: delete n characters, enter insert mode
  391. X-   t: Not implemented
  392. X-   u: Not implemented (see U)
  393. X    v: Unused
  394. X*  nw: advance word (see W)
  395. X=  nx: delete n characters
  396. X*  ny: yank text to save buffer - will save n lines into save buffer
  397. X       (Only one save buffer, 1st y clears buffer, rest add until
  398. X    non y command entered. dd works in a similar fashion, but
  399. X    kills as it saves (if cut_mode enabled)).
  400. X=   z: refresh screen (^L,^R)
  401. X-   {: Not implemented
  402. X-   |: Not implemented
  403. X=  n~: Change case of next n characters
  404. X* nDEL: Same as X, delete previous character
  405. X
  406. SHAR_EOF
  407. echo Extracting emax.ref:
  408. sed 's/^X//' >emax.ref <<\SHAR_EOF
  409. X                EMAX - TVX emulating emacs
  410. X
  411. X     Important differences:  No windows, no marked region, no Q registers,
  412. Xno word delete/case change, ^K interacts differently with save buffer
  413. Xmultiple keyboard macros (called repeat loops), much different file
  414. Xand buffer manipulation.
  415. X
  416. X     Partial line ^K's (no argument or 0 argument) will save the deleted
  417. Xtext in the unkill buffer (^CU), but NOT the save/cut buffer.  If an
  418. Xargument is supplied, then the killed lines are save in the save buffer.
  419. X
  420. X     TVX'x kill last thing concept is implemented as ^C^K.
  421. X
  422. X     Values can be supplied in two ways.  Any of the <esc> commands
  423. Xmay supply a count after the <esc>.  Thus, '<esc>10B' will back over
  424. X10 words.  <esc> may also be used to specify the count for ctrl
  425. Xcommands:  '<esc>10^N' goes down 10 lines.  The usual emacs '^U'
  426. Xalso works to supply arguments.  It works in the emacs multiples
  427. Xof 4, but the Arg: count echoes differently.  When you press ^U,
  428. Xthen the message 'Arg: 4' will appear on the bottom.  If you press
  429. X^U again, it will change to 'Arg: 16'.  However, if you enter
  430. Xany other numeric value, the 'Arg' message disappears, and you
  431. Xget no additional prompting of values.
  432. X     
  433. X
  434. X <ctrl-A>    Move to start of line.
  435. Xn<ctrl-B>    (Back) Move backward by characters.
  436. Xn<ctrl-C>    (Command) TVX Command: execute extended commands provided
  437. X             by TVX base.  (Warning: these ^C commands have NO relation
  438. X             to ^C commands provided by large emacs implemetations!)
  439. X         ^A    Append line to save buffer
  440. X         ^B    Move to absolute beginning of file
  441. X         ^E    Edit repeat buffer
  442. X         ^F    Fill n lines to autowrap margin
  443. X         ^G    No op - exit ^C
  444. X         ^H    Half screen down
  445. X         ^J    Jump back to previous location
  446. X         ^K    Delete last thing
  447. X     ^N    Move to beginning of next line
  448. X     ^M    Mark location n
  449. X         ^P    Move to beginning of previous line
  450. X         ^R    Restore edited repeat buffer
  451. X         ^W    Write buffer, read next portion of file
  452. X          ;    Search forward again
  453. X          ~    Change case of next n characters
  454. X      G    Goto line number n
  455. X          H    Half page up
  456. X      I    Insert ascii char n if n supplied,
  457. X                 otherwise enter insert mode
  458. X          L    Print screen on printer (micros only)
  459. X          M    Return to marked location
  460. X          P    Put line into save buffer
  461. X          S    Search forward across file buffers
  462. X          U    Unkill last single line killed
  463. X          Vp   Set variable p (like TVX's : command)
  464. X          W    Write save buffer to external file
  465. X          Y    Yank external file into save buffer
  466. Xn<ctrl-D>    (Delete) Delete next character.
  467. X <ctrl-E>    (End) Move to end of line.
  468. Xn<ctrl-F>    (Forward) Move forward by characters.
  469. Xn<ctrl-H>    Backspace - delete n previous characters
  470. Xn<ctrl-K>    (Kill) With no argument, kill from current position
  471. X             to end of line; if at the end, kill the newline.
  472. X             With argument 0, kill from beginning of line to current
  473. X             position. Otherwise, kill argument lines forward
  474. X             (if positive) or backward (if negative).
  475. X <ctrl-L>    Redraw the screen.
  476. Xn<ctrl-N>    (Next) Move to next line.
  477. Xn<ctrl-O>    (Open) Open line abover cursor.
  478. Xn<ctrl-P>    (Previous) Move to previous line.
  479. X <ctrl-R>    (Reverse) search backward.
  480. X <ctrl-S>    (Search) search forward. { <Esc>S is a synomymn }
  481. X <ctrl-T>    (Transpose) Transpose characters.
  482. X <ctrl-U>    Specify an argument, as described above.
  483. Xn<ctrl-V>    Move forward by n pages.
  484. X
  485. X <ctrl-X><ctrl-C>  Prompt, and exit unconditionally if 'Y' given.
  486. X <ctrl-X><ctrl-B>  Short buffer status line
  487. Xn<ctrl-X>E   (Execute) Execute current repeat loop n times.
  488. X
  489. X <ctrl-Y>    (Yank) Yank save buffer to current location.
  490. X <ctrl-Z>    Save current buffer to associated file and exit.
  491. Xn<Del>       Delete the previous n characters. (^H is synonymn)
  492. X
  493. X <esc>%      Invoke command file (TVX @ file)
  494. X <esc>!      Call operating system
  495. Xn<esc>#p     Execute repeat loop 'p' 'n' times.
  496. Xn<esc>(      Begin a repeat definition.  ')<esc><esc>' ends loop.
  497. X <esc>-,0-9  Auto arugument for other <esc> and CTRL commands.
  498. X <esc><      Move to beginning of buffer.
  499. X <esc>>      Move to end of buffer.
  500. X <esc>?      Help and status screens
  501. Xn<esc>B      (Back) Move backward by words.
  502. Xn<esc>F      (Forward) Move forward by words.
  503. Xn<esc>V      Move backward by pages.
  504. X
  505. SHAR_EOF
  506. echo Extracting tvx_tut.doc:
  507. sed 's/^X//' >tvx_tut.doc <<\SHAR_EOF
  508. X
  509. X
  510. X        ****************************************************************
  511. X        *                                                              *
  512. X        *                 TVX Interactive Introductions                *
  513. X        *                                                              *
  514. X        ****************************************************************
  515. X                                  **** 1 ****
  516. X     This is a demonstration of the capabilities of TVX.  Commands to TVX
  517. Xconsist of single key mnemonic commands.  TVX is what is known as a two mode
  518. Xeditor - command mode and insert mode.  TVX is normally in command mode, and
  519. Xkeystrokes are interpreted as commands like 'up', 'down', 'find', etc.  When
  520. Xyou enter an 'i' for insert, TVX enters insert mode which allows you to enter
  521. Xtext into the file.  For this lesson, you will be requested to enter commands.
  522. XEach command key you are to enter will be enclosed in 'single quotes'.  Thus, a
  523. Xrequest to enter 'd' means that you should simply hit the 'd' key on the
  524. Xkeyboard.  Each time you hit the 'd' key, the blinking cursor will move down
  525. Xone line.  NOW, hit the 'd' key repeatedly until '**** 2 ****' and part 2 of
  526. Xthis demo shows on the screen.  (You will have to hit the 'd' key around 20
  527. Xtimes.) Do that NOW. 
  528. X                                  **** 2 ****
  529. X     Welcome to part two of the lesson.  Continue to hit the 'd' key until the
  530. X'**** 2 ****' is at the very top of the screen. 
  531. X     TVX was written by Dr. Bruce Wampler, and has been released to the public
  532. Xdomain.  It has versions running on CP/M-80, the IBM-PC, generic MS-DOS, the
  533. XAtari 520ST, and several versions of Unix.  If you read the instructions and
  534. Xenter the commands when requested, you should get a good demonstration of the
  535. Xpower of TVX.  This lesson is organized into several sections.  Each section
  536. Xwill start with a line in the form '**** 1 ****'. 
  537. X     Most of the commands to TVX have been chosen to be mnemonic - thus it is
  538. X'd' for down, 'u' for up, 'l' for left, and 'r' for right.  Pressing any of
  539. Xthose four keys now will allow you to move the cursor around the screen.  The
  540. X'd' and 'u' commands will move the cursor to the beginning of the next or
  541. Xprevious lines. 
  542. XNOW, hit the four cursor movement keys needed and position the blinking cursor
  543. Xat the beginning of this line.  Whenever we get to a new section, use the 'd'
  544. Xcommand to get the '**** n ****' at the top of the screen. 
  545. X     TVX is easy to use.  Already, you can move around the file and see what is
  546. Xgoing on.  This demo file is actually a text file, just like one you might edit
  547. Xusing TVX.  There are other commands to move the cursor around.  The 'p' (page)
  548. Xcommand moves down 25 lines at a time, which is a new screenful.  Right now,
  549. Xthe cursor should still the line indicated above.  If you NOW hit 'p', part 3
  550. Xwill show up. 
  551. X....  end of part 2 .... 
  552. X                                  **** 3 ****
  553. X     Welcome to section 3. As before, repeatedly hit the 'p' key to position
  554. Xthe **** 3 **** at the top of the screen. 
  555. X     We will now be entering some other TVX commands.  When you are requested
  556. Xto enter a command, the entire sequence will be enclosed in double quotes:
  557. X"cmds".  Remember that commands are mnemonic - one key will enter one command
  558. Xto the editor.  Sometimes entering a command will cause the screen to be
  559. Xupdated, or a message to be printed at the bottom.  Usually, that is normal.  A
  560. Xmajor benefit of a screen editor is "what you see is what you get". 
  561. X     Most of the commands to TVX take optional count arguments.  To enter a
  562. Xcount to a command, you enter the count using the digit keys on the top row of
  563. Xthe keyboard, followed by the command key.  Thus, entering the sequence "10d"
  564. Xwould cause the cursor to go down 10 lines.  Counts may be negative, too.  If
  565. Xyou entered "-1p" (or, equivalently, "-p"), the cursor would move UP one
  566. Xscreenful of text.  This convention for entering counts holds true for all TVX
  567. Xcommands that take count arguments.  You may want to try using 'p' or "10d" or
  568. Xother count instead of repeatedly hitting the 'd' key alone to move around this
  569. Xlesson. 
  570. X     As you use more and more TVX commands, it will be useful to have the quick
  571. Xreference chart on hand.  Don't enter any other commands before requested.
  572. XThis lesson is not foolproof, either.  If you try to get out of sequence of the
  573. Xlesson, then you will likely get lost. 
  574. X(*** Important note for users with limited RAM.  This entire lesson may not fit
  575. Xinto memory at once!  When you get to the point that no more text will scroll
  576. Xup from the bottom, you must hit '^W'.  Pressing both the 'Ctrl' and the 'w'
  577. Xkeys at the same time will cause the next part of the lesson to be read in.)
  578. XNOW, hit 'd' (or a 'p') until **** 4 **** is at the screen top. 
  579. X....  end of part 3 .... 
  580. X                                  **** 4 ****
  581. X     We will now actually edit some text.  NOTE: This IS a scratch file, so
  582. Xdon't worry about changing it.  The 'k' (for kill a character) command can be
  583. Xused to delete a single character at a time.  By hitting the 'k' key once, the
  584. Xcharacter the cursor is positioned on will be deleted.  A "5k" would delete the
  585. Xnext 5 characters.  NOW, use the four cursor motion commands to position the
  586. Xcursor on the following sharp: #. We will delete this text.  After the cursor
  587. Xis on the #, repeatedly hit the 'k' key and delete only the sentence
  588. Ximmediately following the #.
  589. X     We will continue with simple editing of text.  If at any time, the text is
  590. Xoff the bottom of the screen, use the 'd' down key to move down and scroll the
  591. Xnew text onto the screen as needed. 
  592. X     The backspace key may be used to delete one character at a time before the
  593. Xcursor.  NOW, position the cursor over the '0' in the following string:
  594. X1234567890abcd.  NOW, use the backspace key to delete the digits before the
  595. X'0'.  If you had used 'k' instead, the characters AFTER the '0' would have been
  596. Xdeleted.  That's all there is to deleting text. 
  597. X     Suppose you want to delete an entire line.  The '^k' key (pressing the
  598. X'Ctrl' key and the 'k' key at the same time, from now on, '^x' means Control-X)
  599. Xwill delete the entire line that the cursor is currently positioned on.  NOW,
  600. Xposition the cursor anywhere on the next line. 
  601. X---- We will delete this entire line ----
  602. XNOW, with the cursor on the previous line, when you hit '^k', it will be
  603. Xdeleted.  Of course, you can use a count argument and delete several lines,
  604. Xforwards or backwards.  Remember that counts are entered using the by entering
  605. Xa count before the command key.  NOW, position the cursor on the next line. 
  606. XWe will now delete 5 lines.  NOW, enter the command sequence "5^k". 
  607. XThis is line 2 to be killed. 
  608. XLine 3
  609. XLine 4
  610. XLine 5
  611. X     Those 5 lines should now be gone. 
  612. X     What if you accidentally kill a line?  You can get it back! 
  613. XNOW, position the cursor on this line and hit '^k'. 
  614. XIt's gone.  NOW, before you enter any other commands, press '^g' (for get
  615. Xback).  That line is back!  This works only for the last killed line, however.
  616. XIf you had entered "5^k", then only the last line would have been recovered.
  617. XThe last line killed will be saved until another line is killed. 
  618. X     Two other useful commands are available for deleting text.  You may want
  619. Xto delete the rest of a given line, or you may want to delete the first part of
  620. Xthe line.  NOW, position the cursor over the c on the next line:
  621. X1234567890abcdef
  622. XIf you now hit '"' key (double quote), the part of the line from the 'c'
  623. Xonwards will be deleted.  Now move the cursor back to the '0'on that line.  To
  624. Xdelete the first part of the line, use ''' (single quote).  You should now have
  625. X'0ab' on that line, since the ''' does not include the character the cursor is
  626. Xon.  The '^G' unkill command works for ''' and '"', just like '^k'. 
  627. X     NOW, move the cursor down and get part 5 (**** 5 ****) to the top of the
  628. Xscreen.  You can use 'p' or 'd'. 
  629. X....  end of part 4 .... 
  630. X                                  **** 5 ****
  631. X     We will now insert some text.  To insert text, you first position the
  632. Xcursor to the place you want to insert the text.  Then enter the 'i' (for
  633. Xinsert) to enter insert mode, then enter the text you want to insert using the
  634. Xregular keyboard keys.  Notice that the message '### Insert Mode ###' appears
  635. Xon the bottom of the screen.  On some versions, the shape of the cursor will
  636. Xchange, too.  As you type, the text you enter will appear on the screen in
  637. Xfront of the cursor: "what you see is what you get".  As you continue, all
  638. Xcharacters that you type will continue to be inserted.  When you are done
  639. Xinserting text, press the 'Esc' key.  You will now be back in command mode. 
  640. X     NOW, let's try to insert something.  How about your name.  Position the
  641. Xcursor over the period (.) on the next line:
  642. XMy name is: .
  643. XNOW, press 'i' to enter insert mode, then type your name, and finally press
  644. X'Esc' to return to command mode.  That is all there is to inserting text.  TVX
  645. Xis a line oriented editor, which is most useful for entering programs.  You
  646. Xpress the 'Return' key to end a line and begin a new one. 
  647. X     Sometimes you may want to insert a block of text in the middle of a line,
  648. Xor before some existing text.  You can simply enter the text, but the constant
  649. Xshifting of text to the right can be visually unpleasant.  The 'o' (open)
  650. Xcommand will open a new line for inserting text.  Try it. 
  651. X     The next section covers the find pattern command will show you how to
  652. Xsearch for text and find the section or line of the file you want to edit. 
  653. X....  end of part 5 .... 
  654. X                                  **** 6 ****
  655. X     It is often useful to be able to find a particular word or pattern in the
  656. Xtext file.  The TVX find command may be used for this.  To start the find
  657. Xcommand, you first press the 'f' (find) key.  This will cause the message
  658. X"Find?" to be printed on the bottom of the screen.  You then enter the pattern
  659. Xyou want to find.  The pattern is terminated with an [Esc].  If the pattern is
  660. Xfound, the screen will be updated, and the cursor placed after the pattern.  If
  661. Xthe pattern is not found, the cursor is not changed and "Not found" will be
  662. Xprinted on the bottom.  When entering the pattern, you may use the backspace
  663. Xkey to edit your input.  Each time you hit the backspace key, one character is
  664. Xdeleted. 
  665. X     NOW, let's search for the pattern "replace".  To do this, first hit the
  666. X'f' command, followed by "replace[Esc]".  The cursor will now be placed after
  667. Xthe next occurrence of "replace".  If you had supplied a count of -1 (or -)
  668. Xbefore the 'f', then the search would have been for the first previous
  669. Xoccurrence of "replace". 
  670. X     If you now hit the ';' (find again) key, the next occurrence of the last
  671. Xpattern you found, here "replace", will be found.  TVX always remembers the
  672. Xlast pattern you found, and the ';' command will search again. 
  673. X     Speaking of replace, TVX makes it easy to find a pattern and then either
  674. Xdelete that string or replace it with a new string.  If you hit the '/' (delete
  675. Xlast) key immediately after finding a pattern, that pattern will be deleted.
  676. XTry another ';' to find 'replace' again, and then hit '/'.  If you want to then
  677. Xreplace the text, you can use the '=' command.  It is just like entering "/i". 
  678. X     Normally, the find pattern command ignores upper and lower case.  You can
  679. Xsearch for the exact case, however.  You may also search for arbitrary
  680. Xpatterns.  See the user's manual for details. 
  681. X....  end of part 6 .... 
  682. X                                  **** 7 ****
  683. X     This section covers more cursor movement commands.  So far, we have only
  684. Xused the four cursor motion keys and the 'p' commands.  Two commands let you
  685. Xskip over a word at a time.  These are the 'TAB' and '{' (or '[') commands.
  686. XThus, the 'TAB' key will skip over the next word to the right.  The '{' skips
  687. Xover words backwards.  Try using those two commands to see how they work. 
  688. X     The '.' (period, usually the same key as '>') command will move the cursor
  689. Xto the end of the current line.  The ',' (comma, on the same key as '<')
  690. Xcommand moves the cursor to the beginning of the line.  Experiment with those
  691. Xtwo commands. 
  692. X     You may have noticed that the 'u' and 'd' commands always move the cursor
  693. Xto the beginning of the line.  Two commands will move the cursor vertically,
  694. Xbut keep it in the same column.  The '^d' key moves down in the same column,
  695. Xand the '^u' command moves up in the same column.  Try using 'u', 'd', '^u',
  696. Xand '^d' to see the difference in their operation. 
  697. X     The 'p' command moves up and down (with a - count) a screenful.  The 'h'
  698. Xcommand keys will move the cursor a half screenful at a time. 
  699. X     You also can get to the very beginning or the very end of the file.  These
  700. Xcommands are 'b' (begin) and 'e' (end).  Whenever you enter a command that
  701. Xmoves the cursor a long ways, TVX remembers where you came from.  Immediately
  702. Xafter entering a command that changes the cursor location, you can use the 'j'
  703. X(jump back) command to return the cursor to the previous location.  For
  704. Xexample, if you enter 'b' followed by a 'j', you will move to the beginning,
  705. Xthen jump back to here.  The 'j' is most useful after the begin and end
  706. Xcommands, as well as after a 'f' find command. 
  707. X....  end of part 7 .... 
  708. X                                  **** 8 ****
  709. X     We will now cover some of the more advanced features of TVX, such as
  710. Xmoving blocks of text and entering editing macros.  TVX can be used to easily
  711. Xmove text around a file.  First, lets move a copy of the following three lines
  712. Xdown a ways.  Use 'd' to place the cursor at the beginning of the following
  713. Xthree lines. 
  714. XSaved line 1 Saved line 2 Saved line 3
  715. XNOW, hit the 's' (for save) command three times (or "3s").  Note that the
  716. Xcursor moved down three lines and is now positioned over the NOW.  We will make
  717. Xa copy of those lines below here.  Place the cursor over the # on the next
  718. Xline. 
  719. X# The saved text will get copied above this line
  720. XIf you now hit the 'g' (get) command, a copy of the three saved lines will get
  721. Xinserted right before the # line.  These commands are called 'Save line' and
  722. X'Get back saved text'. 
  723. X     Remember the '/' delete pattern command used on 'f' find?  That command
  724. Xreally is "delete last thing", where the last "thing" can be a find pattern as
  725. Xbefore, or the text just saved in the save buffer, or the text just gotten from
  726. Xthe save buffer.  Now we can easily move several lines of text.  Save the
  727. Xfollowing two lines by positioning the cursor at the beginning of the first and
  728. Xthen hitting 's' twice. 
  729. XMove this line 1 Move this line 2
  730. XNow the cursor will be at the beginning of this line.  If you now hit the '/'
  731. Xkey, those two lines will be deleted.  Move them to the following line by
  732. Xpositioning the cursor and hitting the 'g' to get them back. 
  733. XMove them to in front of this line. 
  734. X     Each time you hit the 's' key, another line is saved in the save buffer.
  735. XIf you don't enter any other commands between consecutive 's' commands (or 's'
  736. Xwith counts) continue to add text to the save buffer.  The first 's' command
  737. Xentered following any other command will first clear whatever text might
  738. Xalready be in the save buffer. 
  739. X     If you want to save a few lines from one part of the file, then a few more
  740. Xfrom a different place, you can use the 'a' append command.  Append is very
  741. Xmuch like the save command except that it always adds on to the end of the save
  742. Xbuffer and will not clear it if there are other commands between. 
  743. X     A few more words about the '/' delete last thing command.  So far you have
  744. Xseen how '/' works with the 'find' and 'save' commands.  It also works right
  745. Xafter a 'g' get command, so if you get text to the wrong place, you simply need
  746. Xto hit '/' to delete it again.  '/' also works right after the 'TAB' and '{'
  747. Xcommands, which makes it easy to delete words.  If you entered "5[TAB]"
  748. Xfollowed by a '/', the cursor would skip over 5 words and then those 5 words
  749. Xwould be deleted.  You may try that here if you wish to see it work. 
  750. X....  end of part 8 .... 
  751. X                                  **** 9 ****
  752. X     This section demonstrates the use of the repeat buffer.  The repeat buffer
  753. Xallows you to enter one or several commands and cause them to be repeatedly
  754. Xexecuted.  For example, suppose you wanted to change the next 3 occurrences of
  755. X'abc' to 'wxyz'.  Using the 'f' find and '/' delete last (or even '=' delete
  756. Xlast and insert) commands to do this manually can be time consuming.  It would
  757. Xbe difficult to do this if there were 100 changes to make.  The repeat loop
  758. Xsolves this problem.  To do the example one time, you might enter the
  759. Xfollowing: "fabc[Esc]=wxyz[Esc]".  (Note that [Esc] means the Escape key, and
  760. Xwill be echoed on the bottom of the screen as a '$'.) We will now do this three
  761. Xtimes.  FIRST, position at the beginning of the next line. 
  762. XThe cursor should be at the beginning of this line.  Now, enter a '3' followed
  763. Xby the '<' (begin loop) key.  That will cause the message "repeat: 3<" to be
  764. Xprinted on the bottom line.  Now, enter the above command:
  765. X"fabc[Esc]=wxyz[Esc]".  That is the body of the repeat loop.  To change the
  766. Xnext 3 abc's (abc), now terminate the loop by entering ">[Esc][Esc]".  The '>'
  767. X(upper case comma key) closes the loop, and the double [Esc] is necessary to
  768. Xterminate the loop.  Note that the [Esc] echoes as '$'.  Now, the next three
  769. Xoccurrences of abc will have been changed to 'wxyz'.  If there had been less
  770. Xthan three occurrences of 'abc', then the loop would have terminated early with
  771. Xan error message.  You may use the backspace key to edit your input to the
  772. Xrepeat command, just as with find. 
  773. X     Now suppose you want to change the next 'abc' into 'wxyz'.  TVX remembers
  774. Xthe loop you just entered.  (Actually, there are 3 to 9 different repeat loops
  775. Xwhich can be displayed by entering the '?' help command.) Now, to change one
  776. Xmore 'abc', press the '&' key.  The 'Rpt agn' command will cause the loop to be
  777. Xre-executed count times. 
  778. X     These repeats can get quite complex.  This can be a danger, but is a
  779. Xpowerful tool.  Any of the 3 to 9 repeat loop buffers can be selected and used
  780. Xto hold TVX command macros.  The Reference Manual explains how to use the
  781. Xmultiple repeat buffers.  By doing nothing, however, you still get the one
  782. Xdefault repeat loop with no extra worry or action on your part. 
  783. X....  end of part 9 .... 
  784. X                                 **** 10 ****
  785. X     There is one command that you may find useful occasionally (at least on
  786. Xsingle user systems such as an IBM-PC): screen print.  The '^p' command will
  787. Xcause the current screen to be sent to the printer (if there is one!).  By
  788. Xconsecutively hitting '^p', 'p', ..., you can print as much of your file as you
  789. Xwish.  You can try that now if you have a printer and it is ready. 
  790. X....  end of part 10 .... 
  791. X                                 **** 11 ****
  792. X     TVX has one other major feature that may occasionally be useful to you.
  793. XYou can read in an external file into the save buffer.  The 'g' get command can
  794. Xthen be used to insert that text into the file you are editing.  To use this
  795. Xcommand, press '^y' (for yank).  You will be asked for the name of a file.
  796. XThat file will be read in.  If you now position the cursor and press 'g', the
  797. Xcontents of that file will be placed in the current buffer. 
  798. X     The opposite of '^y' is "-^y".  You can save a portion of the current file
  799. Xin another one.  Save the section you want to write in the save buffer using
  800. Xthe 's' command, then enter "-^y".  You will be asked for the name of the file
  801. Xto write to.  The current contents of the save buffer will then be saved in
  802. Xthat file. 
  803. X                                 **** 12 ****
  804. X     TVX has several features that improve its interaction with nroff type text
  805. Xformatters.  (These formatters typically have formatting commands that begin
  806. Xwith a period in column one of the line.) One is the auto-wrap feature.  With
  807. Xthe feature, TVX will automatically wrap around when you pass a specified
  808. Xcolumn when entering text.  To turn on auto-wrap, enter the command "70:w".
  809. XThe 70 means wrapping will occur when you enter the first space after column
  810. X79.  The ':' is a general 'set' command used to set various parameters to TVX. 
  811. XWhen you use auto-wrap, you will get source text with a generally even
  812. Xappearance.  However, as you edit text, you will find the
  813. Xlines getting uneven, just like this text. The "tidy" command can be
  814. Xused to even out these lines.  Move the cursor
  815. Xto the beginning of this text, and enter "8t". Each
  816. X't' will tidy one line.  Tidy works very much like a formatter's filling,
  817. Xand knows about dot commands.  It also won't tidy lines beginning
  818. Xwith a blank or tab.
  819. X                                **** last ****
  820. X     TVX has several other features and commands.  These are described in
  821. Xdetail in the TVX reference manual.  This lesson has tried to give examples of
  822. Xsome of the more commonly used features of TVX. 
  823. X     Feel free to experiment on this lesson file with all the commands provided
  824. Xby TVX.  The best way to learn about the operation of TVX is by using it.  You
  825. Xare on your own now.  When you are done, you can exit TVX with the '^X' exit
  826. Xcommand.  You should have a good idea of the philosophy of TVX now, and can
  827. Xread the user's manual with new insight. 
  828. XRemember - '^x' to exit, 'b' for beginning, 'e' for end
  829. SHAR_EOF
  830. echo ALL DONE!
  831. exit 0
  832.  
  833.